feat(introspection): add typed machine graph metadata#8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8b22edb89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let mut sites = Vec::new(); | ||
| for entry in &analysis.impls { | ||
| if !entry.attrs.iter().any(|attr| attr == "transition") { | ||
| continue; |
There was a problem hiding this comment.
Derive GRAPH from cfg-pruned transition items
collect_transition_sites is walking the raw parsed file here, so the new introspection graph is based on every #[transition] impl that appears in source rather than the impls/methods that actually survive #[cfg] and macro expansion. In a feature-gated machine, disabled transitions still get TransitionIds (and mutually exclusive variants can even collide and fail the build), while macro_rules!/include!-generated transitions never appear in GRAPH at all. That makes the new “exact transition-site” metadata incorrect whenever the transition set depends on build configuration or generated code.
Useful? React with 👍 / 👎.
b8b22ed to
fd93e5c
Compare
Summary
Add first-class machine introspection generated from the Statum machine definition itself.
This lets downstream crates use the machine definition as both:
What Changed
statum-coreMachineIntrospectionMachineStateIdentityMachineGraphand descriptor/query typesStateId,TransitionId, and staticGRAPHmetadata from#[machine]0.6.6Validation
cargo test --workspacecargo test --offline -p statum-macros --test macro_errorscargo test --offline -p macro_registry -p statumcargo test --offline -p statum-core